This library was written by Fookes Software to serve as a demonstration of the varied tasks that can be performed by the Editor Clipbook. You are free to customize it any way you like!
The Clips provided in this library require Bradsoft's TopStyle CSS editor, version 1.51 or above. For more information about TopStyle, please visit the TopStyle home page at:
http://www.bradsoft.com/topstyle/
If you have a useful Clipbook library that you would like to share with other NoteTab users, please submit it to: <clipbook@fookes.com>. Your library will then be added to the Clipbook repository on the web.
H="; "
H="TopStyle Home Page"
^!URL http://www.bradsoft.com/redir.asp?id=130
H="Download TopStyle"
^!URL http://www.bradsoft.com/redir.asp?id=131
H="; "
H="Edit Style Block"
;Is TopStyle available? Clip ends if not.
^!Clip "Check TopStyle Enabled"
;Don't select the <style>..</style> tags!
^!Set %Str%=^$GetSelection$
^!IfTrue ^$IsEmpty(^%Str%)$ FindTag
^!Set %StyleStart%=^$GetRowStart$:^$GetColStart$
^!Set %StyleEnd%=^$GetRowEnd$:^$GetColEnd$
^!Goto CheckCommentTag
:FindTag
^!Find "<style>" TIWS
^!IfError Next ELSE EndTag
^!Find "<style" TIWSC
^!IfError InformError
^!Find ">" TIS
^!IfError InformError
:EndTag
^!Jump SELECT_END
^!Set %StyleStart%=^$GetRow$:^$GetCol$
^!Find "</style>" TIWS
^!IfError InformError
^!Jump SELECT_START
^!Set %StyleEnd%=^$GetRow$:^$GetCol$
^!SelectTo ^%StyleStart%
:CheckCommentTag
^!Find "<!--" TIHS
^!IfError Start
^!Jump SELECT_END
^!Set %StyleStart%=^$GetRow$:^$GetCol$
^!Find "-->" TIS
^!IfError ^!SetCursor ^%StyleEnd%
^!Jump SELECT_START
^!SelectTo ^%StyleStart%
:Start
^!Set %Str%=^$GetSelection$
;Invoke the TopStyle editor
^!Set %StrNew%=^$EditStyleBlock(^%Str%)$
;Check if style values have changed. If not, end procedure
^!IfSame "^%Str%" "^%StrNew%" End
;Temporarily turn off automatic indenting (if it is enabled)
^!SetPasteIndent Off
^!InsertText ^%StrNew%
^!Goto End
:InformError
^!Prompt Please select the style block you want to edit
H="Edit Style Attribute"
;Is TopStyle available? Clip ends if not.
^!Clip "Check TopStyle Enabled"
;Don't select the quote marks!
^!Set %Str%=^$GetSelection$
;If no text was selected, retrieve all text between quotes
^!IfFalse ^$IsEmpty(^%Str%)$ Start
^!Set %Str%=^$GetQuoteBlock(True)$
^!IfTrue ^$IsEmpty(^%Str%)$ InformError
:Start
;Invoke the TopStyle editor
^!Set %StrNew%=^$EditStyleAttr("^%Str%")$
;Check if attribute values have changed. If not, end procedure
^!IfSame "^%Str%" "^%StrNew%" End
;Temporarily turn off automatic indenting (if it is enabled)
^!SetPasteIndent Off
;Insert modified attribute
^!InsertText ^%StrNew%
^!Goto End
:InformError
^!Prompt Please select the Style attribute you want to edit
^!Prompt Please select the LINK tag defining the Style Sheet you want to edit
H="Edit Style Sheet"
;Is TopStyle available? Clip ends if not.
^!Clip "Check TopStyle Enabled"
;Invoke the TopStyle editor
^!EditStyleSheet ^**
H="; "
H="Open TopStyle"
;Is TopStyle available? Clip ends if not.
^!Clip "Check TopStyle Enabled"
;Open the TopStyle editor
^!EditStyleSheet
H="; "
H="_Check TopStyle Enabled"
^!IfTrue ^$IsTopStyleEnabled$ End
^!Continue This Clip requires Bradsoft's TopStyle CSS editor, version 1.51 or later. Click OK to visit Bradsoft's web site for more information about TopStyle, or click Cancel to abort.